package com.fw.system.web.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fw.common.IdXD;
import com.fw.system.web.dao.TbFriendsMapper;
import com.fw.system.web.model.entity.TbFriends;
import com.fw.system.web.service.ITbFriendsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * <p>
 * 好友列表 服务实现类
 * </p>
 *
 * @author ${author}
 * @since 2023-03-28
 */
@Service
public class TbFriendsServiceImpl extends ServiceImpl<TbFriendsMapper, TbFriends> implements ITbFriendsService {


    @Autowired
    private IdXD idXD;

    @Override
    public void addFriends(TbFriends friends) {

        friends.setCreateTime(LocalDateTime.now());
        friends.setId(idXD.nextId()).insert();
    }
}
